#pragma once

#include <iostream>
#include <fstream>
#include <string>
#include <list>
#include "Globals.hpp"
#include "Colors.hpp"
using namespace std;

#define Log ExecutionLog::Instance()
//	Execution Log Class
//	-----------------------------------------------------------------------
//	Type: Singleton
//	Description: It logs any executions reported by AddMessage and displays 
//					the last five such messages.

#define ExecuteLog ExecutionLog::Instance()

class ExecutionLog 
{
	enum animationState
	{
		addingMessage,
		idle
	};

private:

	ExecutionLog() {}
	ofstream executionLog;
	list<string> m_Log;
	list<OGL_Color> m_Colors;
	int m_MessageNum; // The number of the latest log message. (also the number of messages passed to the 
						// execution log so far). 

public:
	
	static ExecutionLog* Instance();
	void Init();
	
	void AddMessage(string message, OGL_Color color = black); // Adds a message to the message list
	void AddMessage(char* message, OGL_Color color = black);
	void Display(); // Displays the top 5 messages at the top of the screen. 

	void CloseFile();
};